<div class="modal fade" #modal data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" (click)="toggleModalClose()">
          <span aria-hidden="true">×</span></button>
        <h4 class="modal-title">附件上传</h4>
      </div>
      <div class="modal-body">
        <table class="table table-hover table-bordered no-margin">
          <thead>
          <tr>
            <th width="50%">附件名称</th>
            <th>上传状态</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let item of uploader.queue">
            <td><strong>{{ item?.file?.name }}</strong></td>
            <td>
              <div class="progress" style="margin-bottom: 0;">
                <div class="progress-bar" role="progressbar" [ngStyle]="{ 'width': item.progress + '%' }"></div>
              </div>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default pull-right" (click)="toggleModalClose()">关闭</button>
        <button type="button" class="btn btn-danger pull-left"
                [disabled]="!isCanDelete()" (click)="removeFile()">
          <span class="fa fa-remove"></span>
          删除
        </button>
        <button type="button" class="btn btn-success pull-left" [disabled]="!isCanUpload()"
                (click)="uploadFile()">
          <span class="fa fa-cloud-upload"></span>
          上传
        </button>
        <button type="button" class="btn btn-default pull-left" [disabled]="uploader.queue.length >= 1"
                [attr.alt]="uploader.queue.length >= 1 ? '最多只能上传一个附件，如需上传新附件，请先删除原附件':''"
                [attr.title]="uploader.queue.length >= 1 ? '最多只能上传一个附件，如需上传新附件，请先删除原附件':''"
                (click)="fileInput.click();">
          <span class="fa a-file"></span>
          选择附件
        </button>
        <form novalidate #form class="hidden">
          <input type="file" ng2FileSelect #fileInput id="uploadFile"
                 [uploader]="uploader" (change)="setFileOnChange($event)"/>
        </form>
      </div>
    </div>
  </div>
</div>
